package com.wwf.service.impl;

import com.wwf.service.ITestTpService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;
import java.util.concurrent.TimeUnit;


@Service
public class TestTpServiceImpl implements ITestTpService {
    @Override
    public String testA(String name) {
        Random r1 = new Random();
        long nextInt2 = r1.nextInt(100);
        try {
            TimeUnit.MILLISECONDS.sleep(nextInt2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "testA hello to "+name;
    }

    @Override
    public String testB(String name) {
       // Random r1 = new Random();
       // long nextInt2 = r1.nextInt(100);
        try {
            TimeUnit.MILLISECONDS.sleep(30);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "testB hello to "+name;
    }

    @Override
    public String testC(String name) {
        return "testC hello to "+name;
    }
}
